home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PINBSRC.ZIP / _GRAPH.PAS < prev    next >
Pascal/Delphi Source File  |  1996-02-02  |  41KB  |  2,847 lines

  1. { _GRAPH.PAS  - Ansgar Scherp, Joachim Gelhaus
  2.   all rights reserved / vt'95 }
  3.  
  4. procedure get_ground_s1;
  5. var z:byte;
  6.     z1,z2,z3,z4:word;
  7. begin
  8.   z3:=bally+48;
  9.   z4:=ballx div 4;
  10.   asm
  11.     push ax
  12.     push dx
  13.     mov ax,0004h
  14.     mov dx,03ceh
  15.     out dx, ax
  16.     pop dx
  17.     pop ax
  18.  
  19.     push ax
  20.     push si
  21.     push di
  22.     push cx
  23.     push es
  24.  
  25.     mov z,1
  26.     @loop:
  27.       push ds
  28.       xor ah,ah
  29.       mov al,z
  30.       mov cl,4
  31.       mul cl
  32.       mov z1,ax
  33.  
  34.       xor ah,ah
  35.       mov al,z
  36.       add ax,z3
  37.       mov cx,80
  38.       mul cx
  39.       add ax,z4
  40.       mov z2,ax
  41.  
  42.       mov es,[groundseg]
  43.       mov ds,[vseg]
  44.       mov si,z2
  45.       mov di,z1
  46.       mov cx,2
  47.       rep movsw
  48.  
  49.       mov al,z
  50.       inc al
  51.       mov z,al
  52.       cmp al,16
  53.  
  54.       pop ds
  55.     jnz @loop
  56.     pop es
  57.     pop cx
  58.     pop di
  59.     pop si
  60.     pop ax
  61.   end;
  62.  
  63.   asm
  64.     push ax
  65.     push dx
  66.     mov ax,0104h
  67.     mov dx,03ceh
  68.     out dx, ax
  69.     pop dx
  70.     pop ax
  71.  
  72.     push ax
  73.     push si
  74.     push di
  75.     push cx
  76.     push es
  77.  
  78.     mov z,1
  79.     @loop:
  80.       push ds
  81.       xor ah,ah
  82.       mov al,z
  83.       mov cl,4
  84.       mul cl
  85.       add ax,64
  86.       mov z1,ax
  87.  
  88.       xor ah,ah
  89.       mov al,z
  90.       add ax,z3
  91.       mov cx,80
  92.       mul cx
  93.       add ax,z4
  94.       mov z2,ax
  95.  
  96.       mov es,[groundseg]
  97.       mov ds,[vseg]
  98.       mov si,z2
  99.       mov di,z1
  100.       mov cx,2
  101.       rep movsw
  102.  
  103.       mov al,z
  104.       inc al
  105.       mov z,al
  106.       cmp al,16
  107.  
  108.       pop ds
  109.     jnz @loop
  110.     pop es
  111.     pop cx
  112.     pop di
  113.     pop si
  114.     pop ax
  115.   end;
  116.  
  117.   asm
  118.     push ax
  119.     push dx
  120.     mov ax,0204h
  121.     mov dx,03ceh
  122.     out dx, ax
  123.     pop dx
  124.     pop ax
  125.  
  126.     push ax
  127.     push si
  128.     push di
  129.     push cx
  130.     push es
  131.  
  132.     mov z,1
  133.     @loop:
  134.       push ds
  135.       xor ah,ah
  136.       mov al,z
  137.       mov cl,4
  138.       mul cl
  139.       add ax,128
  140.       mov z1,ax
  141.  
  142.       xor ah,ah
  143.       mov al,z
  144.       add ax,z3
  145.       mov cx,80
  146.       mul cx
  147.       add ax,z4
  148.       mov z2,ax
  149.  
  150.       mov es,[groundseg]
  151.       mov ds,[vseg]
  152.       mov si,z2
  153.       mov di,z1
  154.       mov cx,2
  155.       rep movsw
  156.  
  157.       mov al,z
  158.       inc al
  159.       mov z,al
  160.       cmp al,16
  161.  
  162.       pop ds
  163.     jnz @loop
  164.     pop es
  165.     pop cx
  166.     pop di
  167.     pop si
  168.     pop ax
  169.   end;
  170.  
  171.   asm
  172.     push ax
  173.     push dx
  174.     mov ax,0304h
  175.     mov dx,03ceh
  176.     out dx, ax
  177.     pop dx
  178.     pop ax
  179.  
  180.     push ax
  181.     push si
  182.     push di
  183.     push cx
  184.     push es
  185.  
  186.     mov z,1
  187.     @loop:
  188.       push ds
  189.       xor ah,ah
  190.       mov al,z
  191.       mov cl,4
  192.       mul cl
  193.       add ax,192
  194.       mov z1,ax
  195.  
  196.       xor ah,ah
  197.       mov al,z
  198.       add ax,z3
  199.       mov cx,80
  200.       mul cx
  201.       add ax,z4
  202.       mov z2,ax
  203.  
  204.       mov es,[groundseg]
  205.       mov ds,[vseg]
  206.       mov si,z2
  207.       mov di,z1
  208.       mov cx,2
  209.       rep movsw
  210.  
  211.       mov al,z
  212.       inc al
  213.       mov z,al
  214.       cmp al,16
  215.  
  216.       pop ds
  217.     jnz @loop
  218.     pop es
  219.     pop cx
  220.     pop di
  221.     pop si
  222.     pop ax
  223.   end;
  224. end;
  225.  
  226. procedure get_ground_s2;
  227. var z:byte;
  228.     z1,z2,z3,z4:word;
  229. begin
  230.   z3:=bally+48;
  231.   z4:=ballx div 4;
  232.   asm
  233.     push ax
  234.     push dx
  235.     mov ax,0104h
  236.     mov dx,03ceh
  237.     out dx, ax
  238.     pop dx
  239.     pop ax
  240.  
  241.     push ax
  242.     push si
  243.     push di
  244.     push cx
  245.     push es
  246.  
  247.     mov z,1
  248.     @loop:
  249.       push ds
  250.       xor ah,ah
  251.       mov al,z
  252.       mov cl,4
  253.       mul cl
  254.       mov z1,ax
  255.  
  256.       xor ah,ah
  257.       mov al,z
  258.       add ax,z3
  259.       mov cx,80
  260.       mul cx
  261.       add ax,z4
  262.       mov z2,ax
  263.  
  264.       mov es,[groundseg]
  265.       mov ds,[vseg]
  266.       mov si,z2
  267.       mov di,z1
  268.       mov cx,2
  269.       rep movsw
  270.  
  271.       mov al,z
  272.       inc al
  273.       mov z,al
  274.       cmp al,16
  275.  
  276.       pop ds
  277.     jnz @loop
  278.     pop es
  279.     pop cx
  280.     pop di
  281.     pop si
  282.     pop ax
  283.   end;
  284.  
  285.   asm
  286.     push ax
  287.     push dx
  288.     mov ax,0204h
  289.     mov dx,03ceh
  290.     out dx, ax
  291.     pop dx
  292.     pop ax
  293.  
  294.     push ax
  295.     push si
  296.     push di
  297.     push cx
  298.     push es
  299.  
  300.     mov z,1
  301.     @loop:
  302.       push ds
  303.       xor ah,ah
  304.       mov al,z
  305.       mov cl,4
  306.       mul cl
  307.       add ax,64
  308.       mov z1,ax
  309.  
  310.       xor ah,ah
  311.       mov al,z
  312.       add ax,z3
  313.       mov cx,80
  314.       mul cx
  315.       add ax,z4
  316.       mov z2,ax
  317.  
  318.       mov es,[groundseg]
  319.       mov ds,[vseg]
  320.       mov si,z2
  321.       mov di,z1
  322.       mov cx,2
  323.       rep movsw
  324.  
  325.       mov al,z
  326.       inc al
  327.       mov z,al
  328.       cmp al,16
  329.  
  330.       pop ds
  331.     jnz @loop
  332.     pop es
  333.     pop cx
  334.     pop di
  335.     pop si
  336.     pop ax
  337.   end;
  338.  
  339.   asm
  340.     push ax
  341.     push dx
  342.     mov ax,0304h
  343.     mov dx,03ceh
  344.     out dx, ax
  345.     pop dx
  346.     pop ax
  347.  
  348.     push ax
  349.     push si
  350.     push di
  351.     push cx
  352.     push es
  353.  
  354.     mov z,1
  355.     @loop:
  356.       push ds
  357.       xor ah,ah
  358.       mov al,z
  359.       mov cl,4
  360.       mul cl
  361.       add ax,128
  362.       mov z1,ax
  363.  
  364.       xor ah,ah
  365.       mov al,z
  366.       add ax,z3
  367.       mov cx,80
  368.       mul cx
  369.       add ax,z4
  370.       mov z2,ax
  371.  
  372.       mov es,[groundseg]
  373.       mov ds,[vseg]
  374.       mov si,z2
  375.       mov di,z1
  376.       mov cx,2
  377.       rep movsw
  378.  
  379.       mov al,z
  380.       inc al
  381.       mov z,al
  382.       cmp al,16
  383.  
  384.       pop ds
  385.     jnz @loop
  386.     pop es
  387.     pop cx
  388.     pop di
  389.     pop si
  390.     pop ax
  391.   end;
  392.  
  393.   asm
  394.     push ax
  395.     push dx
  396.     mov ax,0004h
  397.     mov dx,03ceh
  398.     out dx, ax
  399.     pop dx
  400.     pop ax
  401.  
  402.     push ax
  403.     push si
  404.     push di
  405.     push cx
  406.     push es
  407.  
  408.     mov z,1
  409.     @loop:
  410.       push ds
  411.       xor ah,ah
  412.       mov al,z
  413.       mov cl,4
  414.       mul cl
  415.       add ax,192
  416.       mov z1,ax
  417.  
  418.       xor ah,ah
  419.       mov al,z
  420.       add ax,z3
  421.       mov cx,80
  422.       mul cx
  423.       add ax,z4
  424.       inc ax
  425.       mov z2,ax
  426.  
  427.       mov es,[groundseg]
  428.       mov ds,[vseg]
  429.       mov si,z2
  430.       mov di,z1
  431.       mov cx,2
  432.       rep movsw
  433.  
  434.       mov al,z
  435.       inc al
  436.       mov z,al
  437.       cmp al,16
  438.  
  439.       pop ds
  440.     jnz @loop
  441.     pop es
  442.     pop cx
  443.     pop di
  444.     pop si
  445.     pop ax
  446.   end;
  447. end;
  448.  
  449. procedure get_ground_s3;
  450. var z:byte;
  451.     z1,z2,z3,z4:word;
  452. begin
  453.   z3:=bally+48;
  454.   z4:=ballx div 4;
  455.   asm
  456.     push ax
  457.     push dx
  458.     mov ax,0204h
  459.     mov dx,03ceh
  460.     out dx, ax
  461.     pop dx
  462.     pop ax
  463.  
  464.     push ax
  465.     push si
  466.     push di
  467.     push cx
  468.     push es
  469.  
  470.     mov z,1
  471.     @loop:
  472.       push ds
  473.       xor ah,ah
  474.       mov al,z
  475.       mov cl,4
  476.       mul cl
  477.       mov z1,ax
  478.  
  479.       xor ah,ah
  480.       mov al,z
  481.       add ax,z3
  482.       mov cx,80
  483.       mul cx
  484.       add ax,z4
  485.       mov z2,ax
  486.  
  487.       mov es,[groundseg]
  488.       mov ds,[vseg]
  489.       mov si,z2
  490.       mov di,z1
  491.       mov cx,2
  492.       rep movsw
  493.  
  494.       mov al,z
  495.       inc al
  496.       mov z,al
  497.       cmp al,16
  498.  
  499.       pop ds
  500.     jnz @loop
  501.     pop es
  502.     pop cx
  503.     pop di
  504.     pop si
  505.     pop ax
  506.   end;
  507.  
  508.   asm
  509.     push ax
  510.     push dx
  511.     mov ax,0304h
  512.     mov dx,03ceh
  513.     out dx, ax
  514.     pop dx
  515.     pop ax
  516.  
  517.     push ax
  518.     push si
  519.     push di
  520.     push cx
  521.     push es
  522.  
  523.     mov z,1
  524.     @loop:
  525.       push ds
  526.       xor ah,ah
  527.       mov al,z
  528.       mov cl,4
  529.       mul cl
  530.       add ax,64
  531.       mov z1,ax
  532.  
  533.       xor ah,ah
  534.       mov al,z
  535.       add ax,z3
  536.       mov cx,80
  537.       mul cx
  538.       add ax,z4
  539.       mov z2,ax
  540.  
  541.       mov es,[groundseg]
  542.       mov ds,[vseg]
  543.       mov si,z2
  544.       mov di,z1
  545.       mov cx,2
  546.       rep movsw
  547.  
  548.       mov al,z
  549.       inc al
  550.       mov z,al
  551.       cmp al,16
  552.  
  553.       pop ds
  554.     jnz @loop
  555.     pop es
  556.     pop cx
  557.     pop di
  558.     pop si
  559.     pop ax
  560.   end;
  561.   asm
  562.     push ax
  563.     push dx
  564.     mov ax,0004h
  565.     mov dx,03ceh
  566.     out dx, ax
  567.     pop dx
  568.     pop ax
  569.  
  570.     push ax
  571.     push si
  572.     push di
  573.     push cx
  574.     push es
  575.  
  576.     mov z,1
  577.     @loop:
  578.       push ds
  579.       xor ah,ah
  580.       mov al,z
  581.       mov cl,4
  582.       mul cl
  583.       add ax,128
  584.       mov z1,ax
  585.  
  586.       xor ah,ah
  587.       mov al,z
  588.       add ax,z3
  589.       mov cx,80
  590.       mul cx
  591.       add ax,z4
  592.       inc ax
  593.       mov z2,ax
  594.  
  595.       mov es,[groundseg]
  596.       mov ds,[vseg]
  597.       mov si,z2
  598.       mov di,z1
  599.       mov cx,2
  600.       rep movsw
  601.  
  602.       mov al,z
  603.       inc al
  604.       mov z,al
  605.       cmp al,16
  606.  
  607.       pop ds
  608.     jnz @loop
  609.     pop es
  610.     pop cx
  611.     pop di
  612.     pop si
  613.     pop ax
  614.   end;
  615.   asm
  616.     push ax
  617.     push dx
  618.     mov ax,0104h
  619.     mov dx,03ceh
  620.     out dx, ax
  621.     pop dx
  622.     pop ax
  623.  
  624.     push ax
  625.     push si
  626.     push di
  627.     push cx
  628.     push es
  629.  
  630.     mov z,1
  631.     @loop:
  632.       push ds
  633.       xor ah,ah
  634.       mov al,z
  635.       mov cl,4
  636.       mul cl
  637.       add ax,192
  638.       mov z1,ax
  639.  
  640.       xor ah,ah
  641.       mov al,z
  642.       add ax,z3
  643.       mov cx,80
  644.       mul cx
  645.       add ax,z4
  646.       inc ax
  647.       mov z2,ax
  648.  
  649.       mov es,[groundseg]
  650.       mov ds,[vseg]
  651.       mov si,z2
  652.       mov di,z1
  653.       mov cx,2
  654.       rep movsw
  655.  
  656.       mov al,z
  657.       inc al
  658.       mov z,al
  659.       cmp al,16
  660.  
  661.       pop ds
  662.     jnz @loop
  663.     pop es
  664.     pop cx
  665.     pop di
  666.     pop si
  667.     pop ax
  668.   end;
  669. end;
  670.  
  671. procedure get_ground_s4;
  672. var z:byte;
  673.     z1,z2,z3,z4:word;
  674. begin
  675.   z3:=bally+48;
  676.   z4:=ballx div 4;
  677.   asm
  678.     push ax
  679.     push dx
  680.     mov ax,0304h
  681.     mov dx,03ceh
  682.     out dx, ax
  683.     pop dx
  684.     pop ax
  685.  
  686.     push ax
  687.     push si
  688.     push di
  689.     push cx
  690.     push es
  691.  
  692.     mov z,1
  693.     @loop:
  694.       push ds
  695.       xor ah,ah
  696.       mov al,z
  697.       mov cl,4
  698.       mul cl
  699.       mov z1,ax
  700.  
  701.       xor ah,ah
  702.       mov al,z
  703.       add ax,z3
  704.       mov cx,80
  705.       mul cx
  706.       add ax,z4
  707.       mov z2,ax
  708.  
  709.       mov es,[groundseg]
  710.       mov ds,[vseg]
  711.       mov si,z2
  712.       mov di,z1
  713.       mov cx,2
  714.       rep movsw
  715.  
  716.       mov al,z
  717.       inc al
  718.       mov z,al
  719.       cmp al,16
  720.  
  721.       pop ds
  722.     jnz @loop
  723.     pop es
  724.     pop cx
  725.     pop di
  726.     pop si
  727.     pop ax
  728.   end;
  729.   asm
  730.     push ax
  731.     push dx
  732.     mov ax,0004h
  733.     mov dx,03ceh
  734.     out dx, ax
  735.     pop dx
  736.     pop ax
  737.  
  738.     push ax
  739.     push si
  740.     push di
  741.     push cx
  742.     push es
  743.  
  744.     mov z,1
  745.     @loop:
  746.       push ds
  747.       xor ah,ah
  748.       mov al,z
  749.       mov cl,4
  750.       mul cl
  751.       add ax,64
  752.       mov z1,ax
  753.  
  754.       xor ah,ah
  755.       mov al,z
  756.       add ax,z3
  757.       mov cx,80
  758.       mul cx
  759.       add ax,z4
  760.       inc ax
  761.       mov z2,ax
  762.  
  763.       mov es,[groundseg]
  764.       mov ds,[vseg]
  765.       mov si,z2
  766.       mov di,z1
  767.       mov cx,2
  768.       rep movsw
  769.  
  770.       mov al,z
  771.       inc al
  772.       mov z,al
  773.       cmp al,16
  774.  
  775.       pop ds
  776.     jnz @loop
  777.     pop es
  778.     pop cx
  779.     pop di
  780.     pop si
  781.     pop ax
  782.   end;
  783.   asm
  784.     push ax
  785.     push dx
  786.     mov ax,0104h
  787.     mov dx,03ceh
  788.     out dx, ax
  789.     pop dx
  790.     pop ax
  791.  
  792.     push ax
  793.     push si
  794.     push di
  795.     push cx
  796.     push es
  797.  
  798.     mov z,1
  799.     @loop:
  800.       push ds
  801.       xor ah,ah
  802.       mov al,z
  803.       mov cl,4
  804.       mul cl
  805.       add ax,128
  806.       mov z1,ax
  807.  
  808.       xor ah,ah
  809.       mov al,z
  810.       add ax,z3
  811.       mov cx,80
  812.       mul cx
  813.       add ax,z4
  814.       inc ax
  815.       mov z2,ax
  816.  
  817.       mov es,[groundseg]
  818.       mov ds,[vseg]
  819.       mov si,z2
  820.       mov di,z1
  821.       mov cx,2
  822.       rep movsw
  823.  
  824.       mov al,z
  825.       inc al
  826.       mov z,al
  827.       cmp al,16
  828.  
  829.       pop ds
  830.     jnz @loop
  831.     pop es
  832.     pop cx
  833.     pop di
  834.     pop si
  835.     pop ax
  836.   end;
  837.   asm
  838.     push ax
  839.     push dx
  840.     mov ax,0204h
  841.     mov dx,03ceh
  842.     out dx, ax
  843.     pop dx
  844.     pop ax
  845.  
  846.     push ax
  847.     push si
  848.     push di
  849.     push cx
  850.     push es
  851.  
  852.     mov z,1
  853.     @loop:
  854.       push ds
  855.       xor ah,ah
  856.       mov al,z
  857.       mov cl,4
  858.       mul cl
  859.       add ax,192
  860.       mov z1,ax
  861.  
  862.       xor ah,ah
  863.       mov al,z
  864.       add ax,z3
  865.       mov cx,80
  866.       mul cx
  867.       add ax,z4
  868.       inc ax
  869.       mov z2,ax
  870.  
  871.       mov es,[groundseg]
  872.       mov ds,[vseg]
  873.       mov si,z2
  874.       mov di,z1
  875.       mov cx,2
  876.       rep movsw
  877.  
  878.       mov al,z
  879.       inc al
  880.       mov z,al
  881.       cmp al,16
  882.  
  883.       pop ds
  884.     jnz @loop
  885.     pop es
  886.     pop cx
  887.     pop di
  888.     pop si
  889.     pop ax
  890.   end;
  891.  
  892. end;
  893.  
  894. procedure draw_ball_s1;
  895. var z:byte;
  896.     z1,z2,z3,z4:word;
  897. begin
  898.  
  899.   {DRAW_BALL_s1 1}
  900.   z3:=bally+48;
  901.   z4:=ballx div 4;
  902.   asm
  903.     push dx
  904.     push ax
  905.     mov dx,03c4h
  906.     mov ax,258
  907.     out dx,ax
  908.     pop ax
  909.     pop dx
  910.  
  911.     push ax
  912.     push si
  913.     push di
  914.     push cx
  915.     push es
  916.  
  917.     mov z,1
  918.     @loop:
  919.       push ds
  920.       xor ah,ah
  921.       mov al,z
  922.       mov cl,4
  923.       mul cl
  924.       mov z1,ax { z1:=z*4;}
  925.       xor ah,ah
  926.       mov al,z
  927.       add ax,z3
  928.       mov cx,80
  929.       mul cx
  930.       add ax,z4
  931.       mov z2,ax {z2:=(z+z3)*80+z4;}
  932.  
  933.       mov es,[vseg]   {ES:DI}
  934.       mov ds,[ballseg] {DS:SI}
  935.       mov si,z1
  936.       mov di,z2
  937.       mov cx,4
  938.       @l1:
  939.         mov al,[ds:si]
  940.         or al,al
  941.         jz @l2
  942.         mov ah,[es:di]
  943.         cmp ah,farbe
  944.         jz @l2
  945.         mov [es:di],al
  946.         @l2:
  947.         inc si
  948.         inc di
  949.         dec cx
  950.       jnz @l1
  951.       mov al,z
  952.       inc al
  953.       mov z,al
  954.       cmp al,16
  955.       pop ds
  956.     jnz @loop
  957.     pop es
  958.     pop cx
  959.     pop di
  960.     pop si
  961.     pop ax
  962.   end;
  963.  
  964.   {DRAW_BALL_s1 2}
  965.   asm
  966.     push dx
  967.     push ax
  968.     mov dx,03c4h
  969.     mov ax,514
  970.     out dx,ax
  971.     pop ax
  972.     pop dx
  973.  
  974.     push ax
  975.     push si
  976.     push di
  977.     push cx
  978.     push es
  979.  
  980.     mov z,1
  981.     @loop:
  982.       push ds
  983.       xor ah,ah
  984.       mov al,z
  985.       mov cl,4
  986.       mul cl
  987.       add ax,64
  988.       mov z1,ax { z1:=z*4;}
  989.       xor ah,ah
  990.       mov al,z
  991.       add ax,z3
  992.       mov cx,80
  993.       mul cx
  994.       add ax,z4
  995.       mov z2,ax {z2:=(z+z3)*80+z4;}
  996.  
  997.       mov es,[vseg]   {ES:DI}
  998.       mov ds,[ballseg] {DS:SI}
  999.       mov si,z1
  1000.       mov di,z2
  1001.       mov cx,4
  1002.       @l1:
  1003.         mov al,[ds:si]
  1004.         or al,al
  1005.         jz @l2
  1006.         mov ah,[es:di]
  1007.         cmp ah,farbe
  1008.         jz @l2
  1009.         mov [es:di],al
  1010.         @l2:
  1011.         inc si
  1012.         inc di
  1013.         dec cx
  1014.       jnz @l1
  1015.       mov al,z
  1016.       inc al
  1017.       mov z,al
  1018.       cmp al,16
  1019.       pop ds
  1020.     jnz @loop
  1021.     pop es
  1022.     pop cx
  1023.     pop di
  1024.     pop si
  1025.     pop ax
  1026.   end;
  1027.  
  1028.   {DRAW_BALL_s1 3}
  1029.   asm
  1030.     push dx
  1031.     push ax
  1032.     mov dx,03c4h
  1033.     mov ax,1026
  1034.     out dx,ax
  1035.     pop ax
  1036.     pop dx
  1037.  
  1038.     push ax
  1039.     push si
  1040.     push di
  1041.     push cx
  1042.     push es
  1043.  
  1044.     mov z,1
  1045.     @loop:
  1046.       push ds
  1047.       xor ah,ah
  1048.       mov al,z
  1049.       mov cl,4
  1050.       mul cl
  1051.       add ax,128
  1052.       mov z1,ax { z1:=z*4;}
  1053.       xor ah,ah
  1054.       mov al,z
  1055.       add ax,z3
  1056.       mov cx,80
  1057.       mul cx
  1058.       add ax,z4
  1059.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1060.  
  1061.       mov es,[vseg]   {ES:DI}
  1062.       mov ds,[ballseg] {DS:SI}
  1063.       mov si,z1
  1064.       mov di,z2
  1065.       mov cx,4
  1066.       @l1:
  1067.         mov al,[ds:si]
  1068.         or al,al
  1069.         jz @l2
  1070.         mov ah,[es:di]
  1071.         cmp ah,farbe
  1072.         jz @l2
  1073.         mov [es:di],al
  1074.         @l2:
  1075.         inc si
  1076.         inc di
  1077.         dec cx
  1078.       jnz @l1
  1079.       mov al,z
  1080.       inc al
  1081.       mov z,al
  1082.       cmp al,16
  1083.       pop ds
  1084.     jnz @loop
  1085.     pop es
  1086.     pop cx
  1087.     pop di
  1088.     pop si
  1089.     pop ax
  1090.   end;
  1091.  
  1092.   {DRAW_BALL_s1 4}
  1093.   asm
  1094.     push dx
  1095.     push ax
  1096.     mov dx,03c4h
  1097.     mov ax,2050
  1098.     out dx,ax
  1099.     pop ax
  1100.     pop dx
  1101.  
  1102.     push ax
  1103.     push si
  1104.     push di
  1105.     push cx
  1106.     push es
  1107.  
  1108.     mov z,1
  1109.     @loop:
  1110.       push ds
  1111.       xor ah,ah
  1112.       mov al,z
  1113.       mov cl,4
  1114.       mul cl
  1115.       add ax,192
  1116.       mov z1,ax { z1:=z*4;}
  1117.       xor ah,ah
  1118.       mov al,z
  1119.       add ax,z3
  1120.       mov cx,80
  1121.       mul cx
  1122.       add ax,z4
  1123.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1124.  
  1125.       mov es,[vseg]   {ES:DI}
  1126.       mov ds,[ballseg] {DS:SI}
  1127.       mov si,z1
  1128.       mov di,z2
  1129.       mov cx,4
  1130.       @l1:
  1131.         mov al,[ds:si]
  1132.         or al,al
  1133.         jz @l2
  1134.         mov ah,[es:di]
  1135.         cmp ah,farbe
  1136.         jz @l2
  1137.         mov [es:di],al
  1138.         @l2:
  1139.         inc si
  1140.         inc di
  1141.         dec cx
  1142.       jnz @l1
  1143.       mov al,z
  1144.       inc al
  1145.       mov z,al
  1146.       cmp al,16
  1147.       pop ds
  1148.     jnz @loop
  1149.     pop es
  1150.     pop cx
  1151.     pop di
  1152.     pop si
  1153.     pop ax
  1154.   end;
  1155. end;
  1156.  
  1157. procedure draw_ball_s2;
  1158. var z:byte;
  1159.     z1,z2,z3,z4:word;
  1160. begin
  1161.  
  1162.   z3:=bally+48;
  1163.   z4:=ballx div 4;
  1164.   {draw_ball_s2 1}
  1165.   asm
  1166.     push dx
  1167.     push ax
  1168.     mov dx,03c4h
  1169.     mov ax,514
  1170.     out dx,ax
  1171.     pop ax
  1172.     pop dx
  1173.  
  1174.     push ax
  1175.     push si
  1176.     push di
  1177.     push cx
  1178.     push es
  1179.  
  1180.     mov z,1
  1181.     @loop:
  1182.       push ds
  1183.       xor ah,ah
  1184.       mov al,z
  1185.       mov cl,4
  1186.       mul cl
  1187.       mov z1,ax { z1:=z*4;}
  1188.       xor ah,ah
  1189.       mov al,z
  1190.       add ax,z3
  1191.       mov cx,80
  1192.       mul cx
  1193.       add ax,z4
  1194.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1195.  
  1196.       mov es,[vseg]   {ES:DI}
  1197.       mov ds,[ballseg] {DS:SI}
  1198.       mov si,z1
  1199.       mov di,z2
  1200.       mov cx,4
  1201.       @l1:
  1202.         mov al,[ds:si]
  1203.         or al,al
  1204.         jz @l2
  1205.         mov ah,[es:di] {hole farbe}
  1206.         cmp ah,farbe
  1207.         jz @l2
  1208.         mov [es:di],al {setzt einen punkt}
  1209.         @l2:
  1210.         inc si
  1211.         inc di
  1212.         dec cx
  1213.       jnz @l1
  1214.       mov al,z
  1215.       inc al
  1216.       mov z,al
  1217.       cmp al,16
  1218.       pop ds
  1219.     jnz @loop
  1220.     pop es
  1221.     pop cx
  1222.     pop di
  1223.     pop si
  1224.     pop ax
  1225.   end;
  1226.  
  1227.   {draw_ball_s2 2}
  1228.   asm
  1229.     push dx
  1230.     push ax
  1231.     mov dx,03c4h
  1232.     mov ax,1026
  1233.     out dx,ax
  1234.     pop ax
  1235.     pop dx
  1236.  
  1237.     push ax
  1238.     push si
  1239.     push di
  1240.     push cx
  1241.     push es
  1242.  
  1243.     mov z,1
  1244.     @loop:
  1245.       push ds
  1246.       xor ah,ah
  1247.       mov al,z
  1248.       mov cl,4
  1249.       mul cl
  1250.       add ax,64
  1251.       mov z1,ax { z1:=z*4;}
  1252.       xor ah,ah
  1253.       mov al,z
  1254.       add ax,z3
  1255.       mov cx,80
  1256.       mul cx
  1257.       add ax,z4
  1258.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1259.  
  1260.       mov es,[vseg]   {ES:DI}
  1261.       mov ds,[ballseg] {DS:SI}
  1262.       mov si,z1
  1263.       mov di,z2
  1264.       mov cx,4
  1265.       @l1:
  1266.         mov al,[ds:si]
  1267.         or al,al
  1268.         jz @l2
  1269.         mov ah,[es:di]
  1270.         cmp ah,farbe
  1271.         jz @l2
  1272.         mov [es:di],al
  1273.         @l2:
  1274.         inc si
  1275.         inc di
  1276.         dec cx
  1277.       jnz @l1
  1278.       mov al,z
  1279.       inc al
  1280.       mov z,al
  1281.       cmp al,16
  1282.       pop ds
  1283.     jnz @loop
  1284.     pop es
  1285.     pop cx
  1286.     pop di
  1287.     pop si
  1288.     pop ax
  1289.   end;
  1290.  
  1291.   {draw_ball_s2 3}
  1292.   asm
  1293.     push dx
  1294.     push ax
  1295.     mov dx,03c4h
  1296.     mov ax,2050
  1297.     out dx,ax
  1298.     pop ax
  1299.     pop dx
  1300.  
  1301.     push ax
  1302.     push si
  1303.     push di
  1304.     push cx
  1305.     push es
  1306.  
  1307.     mov z,1
  1308.     @loop:
  1309.       push ds
  1310.       xor ah,ah
  1311.       mov al,z
  1312.       mov cl,4
  1313.       mul cl
  1314.       add ax,128
  1315.       mov z1,ax { z1:=z*4;}
  1316.       xor ah,ah
  1317.       mov al,z
  1318.       add ax,z3
  1319.       mov cx,80
  1320.       mul cx
  1321.       add ax,z4
  1322.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1323.  
  1324.       mov es,[vseg]   {ES:DI}
  1325.       mov ds,[ballseg] {DS:SI}
  1326.       mov si,z1
  1327.       mov di,z2
  1328.       mov cx,4
  1329.       @l1:
  1330.         mov al,[ds:si]
  1331.         or al,al
  1332.         jz @l2
  1333.         mov ah,[es:di]
  1334.         cmp ah,farbe
  1335.         jz @l2
  1336.         mov [es:di],al
  1337.         @l2:
  1338.         inc si
  1339.         inc di
  1340.         dec cx
  1341.       jnz @l1
  1342.       mov al,z
  1343.       inc al
  1344.       mov z,al
  1345.       cmp al,16
  1346.       pop ds
  1347.     jnz @loop
  1348.     pop es
  1349.     pop cx
  1350.     pop di
  1351.     pop si
  1352.     pop ax
  1353.   end;
  1354.  
  1355.   {DRAW_BALL_S2 4}
  1356.   asm
  1357.     push dx
  1358.     push ax
  1359.     mov dx,03c4h
  1360.     mov ax,258
  1361.     out dx,ax
  1362.     pop ax
  1363.     pop dx
  1364.  
  1365.     push ax
  1366.     push si
  1367.     push di
  1368.     push cx
  1369.     push es
  1370.  
  1371.     mov z,1
  1372.     @loop:
  1373.       push ds
  1374.       xor ah,ah
  1375.       mov al,z
  1376.       mov cl,4
  1377.       mul cl
  1378.       add ax,192
  1379.       mov z1,ax { z1:=z*4;}
  1380.       xor ah,ah
  1381.       mov al,z
  1382.       add ax,z3
  1383.       mov cx,80
  1384.       mul cx
  1385.       add ax,z4
  1386.       inc ax
  1387.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1388.  
  1389.       mov es,[vseg]   {ES:DI}
  1390.       mov ds,[ballseg] {DS:SI}
  1391.       mov si,z1
  1392.       mov di,z2
  1393.       mov cx,4
  1394.       @l1:
  1395.         mov al,[ds:si]
  1396.         or al,al
  1397.         jz @l2
  1398.         mov ah,[es:di]
  1399.         cmp ah,farbe
  1400.         jz @l2
  1401.         mov [es:di],al
  1402.         @l2:
  1403.         inc si
  1404.         inc di
  1405.         dec cx
  1406.       jnz @l1
  1407.       mov al,z
  1408.       inc al
  1409.       mov z,al
  1410.       cmp al,16
  1411.       pop ds
  1412.     jnz @loop
  1413.     pop es
  1414.     pop cx
  1415.     pop di
  1416.     pop si
  1417.     pop ax
  1418.   end;
  1419. end;
  1420.  
  1421. procedure draw_ball_s3;
  1422. var z:byte;
  1423.     z1,z2,z3,z4:word;
  1424. begin
  1425.   z3:=bally+48;
  1426.   z4:=ballx div 4;
  1427.   {draw_ball_s3 1}
  1428.   asm
  1429.     push dx
  1430.     push ax
  1431.     mov dx,03c4h
  1432.     mov ax,1026
  1433.     out dx,ax
  1434.     pop ax
  1435.     pop dx
  1436.  
  1437.     push ax
  1438.     push si
  1439.     push di
  1440.     push cx
  1441.     push es
  1442.  
  1443.     mov z,1
  1444.     @loop:
  1445.       push ds
  1446.       xor ah,ah
  1447.       mov al,z
  1448.       mov cl,4
  1449.       mul cl
  1450.       mov z1,ax { z1:=z*4;}
  1451.       xor ah,ah
  1452.       mov al,z
  1453.       add ax,z3
  1454.       mov cx,80
  1455.       mul cx
  1456.       add ax,z4
  1457.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1458.  
  1459.       mov es,[vseg]   {ES:DI}
  1460.       mov ds,[ballseg] {DS:SI}
  1461.       mov si,z1
  1462.       mov di,z2
  1463.       mov cx,4
  1464.       @l1:
  1465.         mov al,[ds:si]
  1466.         or al,al
  1467.         jz @l2
  1468.         mov ah,[es:di]
  1469.         cmp ah,farbe
  1470.         jz @l2
  1471.         mov [es:di],al
  1472.         @l2:
  1473.         inc si
  1474.         inc di
  1475.         dec cx
  1476.       jnz @l1
  1477.       mov al,z
  1478.       inc al
  1479.       mov z,al
  1480.       cmp al,16
  1481.       pop ds
  1482.     jnz @loop
  1483.     pop es
  1484.     pop cx
  1485.     pop di
  1486.     pop si
  1487.     pop ax
  1488.   end;
  1489.  
  1490.   {draw_ball_s3 2}
  1491.   asm
  1492.     push dx
  1493.     push ax
  1494.     mov dx,03c4h
  1495.     mov ax,2050
  1496.     out dx,ax
  1497.     pop ax
  1498.     pop dx
  1499.  
  1500.     push ax
  1501.     push si
  1502.     push di
  1503.     push cx
  1504.     push es
  1505.  
  1506.     mov z,1
  1507.     @loop:
  1508.       push ds
  1509.       xor ah,ah
  1510.       mov al,z
  1511.       mov cl,4
  1512.       mul cl
  1513.       add ax,64
  1514.       mov z1,ax { z1:=z*4;}
  1515.       xor ah,ah
  1516.       mov al,z
  1517.       add ax,z3
  1518.       mov cx,80
  1519.       mul cx
  1520.       add ax,z4
  1521.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1522.  
  1523.       mov es,[vseg]   {ES:DI}
  1524.       mov ds,[ballseg] {DS:SI}
  1525.       mov si,z1
  1526.       mov di,z2
  1527.       mov cx,4
  1528.       @l1:
  1529.         mov al,[ds:si]
  1530.         or al,al
  1531.         jz @l2
  1532.         mov ah,[es:di]
  1533.         cmp ah,farbe
  1534.         jz @l2
  1535.         mov [es:di],al
  1536.         @l2:
  1537.         inc si
  1538.         inc di
  1539.         dec cx
  1540.       jnz @l1
  1541.       mov al,z
  1542.       inc al
  1543.       mov z,al
  1544.       cmp al,16
  1545.       pop ds
  1546.     jnz @loop
  1547.     pop es
  1548.     pop cx
  1549.     pop di
  1550.     pop si
  1551.     pop ax
  1552.   end;
  1553.  
  1554.   {DRAW_BALL_S3 3}
  1555.   asm
  1556.     push dx
  1557.     push ax
  1558.     mov dx,03c4h
  1559.     mov ax,258
  1560.     out dx,ax
  1561.     pop ax
  1562.     pop dx
  1563.  
  1564.     push ax
  1565.     push si
  1566.     push di
  1567.     push cx
  1568.     push es
  1569.  
  1570.     mov z,1
  1571.     @loop:
  1572.       push ds
  1573.       xor ah,ah
  1574.       mov al,z
  1575.       mov cl,4
  1576.       mul cl
  1577.       add ax,128
  1578.       mov z1,ax { z1:=z*4;}
  1579.       xor ah,ah
  1580.       mov al,z
  1581.       add ax,z3
  1582.       mov cx,80
  1583.       mul cx
  1584.       add ax,z4
  1585.       inc ax
  1586.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1587.  
  1588.       mov es,[vseg]   {ES:DI}
  1589.       mov ds,[ballseg] {DS:SI}
  1590.       mov si,z1
  1591.       mov di,z2
  1592.       mov cx,4
  1593.       @l1:
  1594.         mov al,[ds:si]
  1595.         or al,al
  1596.         jz @l2
  1597.         mov ah,[es:di]
  1598.         cmp ah,farbe
  1599.         jz @l2
  1600.         mov [es:di],al
  1601.         @l2:
  1602.         inc si
  1603.         inc di
  1604.         dec cx
  1605.       jnz @l1
  1606.       mov al,z
  1607.       inc al
  1608.       mov z,al
  1609.       cmp al,16
  1610.       pop ds
  1611.     jnz @loop
  1612.     pop es
  1613.     pop cx
  1614.     pop di
  1615.     pop si
  1616.     pop ax
  1617.   end;
  1618.   {draw_ball_s3 4}
  1619.   asm
  1620.     push dx
  1621.     push ax
  1622.     mov dx,03c4h
  1623.     mov ax,514
  1624.     out dx,ax
  1625.     pop ax
  1626.     pop dx
  1627.  
  1628.     push ax
  1629.     push si
  1630.     push di
  1631.     push cx
  1632.     push es
  1633.  
  1634.     mov z,1
  1635.     @loop:
  1636.       push ds
  1637.       xor ah,ah
  1638.       mov al,z
  1639.       mov cl,4
  1640.       mul cl
  1641.       add ax,192
  1642.       mov z1,ax { z1:=z*4;}
  1643.       xor ah,ah
  1644.       mov al,z
  1645.       add ax,z3
  1646.       mov cx,80
  1647.       mul cx
  1648.       add ax,z4
  1649.       inc ax
  1650.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1651.  
  1652.       mov es,[vseg]   {ES:DI}
  1653.       mov ds,[ballseg] {DS:SI}
  1654.       mov si,z1
  1655.       mov di,z2
  1656.       mov cx,4
  1657.       @l1:
  1658.         mov al,[ds:si]
  1659.         or al,al
  1660.         jz @l2
  1661.         mov ah,[es:di]
  1662.         cmp ah,farbe
  1663.         jz @l2
  1664.         mov [es:di],al
  1665.         @l2:
  1666.         inc si
  1667.         inc di
  1668.         dec cx
  1669.       jnz @l1
  1670.       mov al,z
  1671.       inc al
  1672.       mov z,al
  1673.       cmp al,16
  1674.       pop ds
  1675.     jnz @loop
  1676.     pop es
  1677.     pop cx
  1678.     pop di
  1679.     pop si
  1680.     pop ax
  1681.   end;
  1682. end;
  1683.  
  1684. procedure draw_ball_s4;
  1685. var z:byte;
  1686.     z1,z2,z3,z4:word;
  1687. begin
  1688.   z3:=bally+48;
  1689.   z4:=ballx div 4;
  1690.   {draw_ball_s4 1}
  1691.   asm
  1692.     push dx
  1693.     push ax
  1694.     mov dx,03c4h
  1695.     mov ax,2050
  1696.     out dx,ax
  1697.     pop ax
  1698.     pop dx
  1699.  
  1700.     push ax
  1701.     push si
  1702.     push di
  1703.     push cx
  1704.     push es
  1705.  
  1706.     mov z,1
  1707.     @loop:
  1708.       push ds
  1709.       xor ah,ah
  1710.       mov al,z
  1711.       mov cl,4
  1712.       mul cl
  1713.       mov z1,ax { z1:=z*4;}
  1714.       xor ah,ah
  1715.       mov al,z
  1716.       add ax,z3
  1717.       mov cx,80
  1718.       mul cx
  1719.       add ax,z4
  1720.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1721.  
  1722.       mov es,[vseg]   {ES:DI}
  1723.       mov ds,[ballseg] {DS:SI}
  1724.       mov si,z1
  1725.       mov di,z2
  1726.       mov cx,4
  1727.       @l1:
  1728.         mov al,[ds:si]
  1729.         or al,al
  1730.         jz @l2
  1731.         mov ah,[es:di]
  1732.         cmp ah,farbe
  1733.         jz @l2
  1734.         mov [es:di],al
  1735.         @l2:
  1736.         inc si
  1737.         inc di
  1738.         dec cx
  1739.       jnz @l1
  1740.       mov al,z
  1741.       inc al
  1742.       mov z,al
  1743.       cmp al,16
  1744.       pop ds
  1745.     jnz @loop
  1746.     pop es
  1747.     pop cx
  1748.     pop di
  1749.     pop si
  1750.     pop ax
  1751.   end;
  1752.  
  1753.   {draw_ball_s4 2}
  1754.   asm
  1755.     push dx
  1756.     push ax
  1757.     mov dx,03c4h
  1758.     mov ax,258
  1759.     out dx,ax
  1760.     pop ax
  1761.     pop dx
  1762.  
  1763.     push ax
  1764.     push si
  1765.     push di
  1766.     push cx
  1767.     push es
  1768.  
  1769.     mov z,1
  1770.     @loop:
  1771.       push ds
  1772.       xor ah,ah
  1773.       mov al,z
  1774.       mov cl,4
  1775.       mul cl
  1776.       add ax,64
  1777.       mov z1,ax { z1:=z*4;}
  1778.       xor ah,ah
  1779.       mov al,z
  1780.       add ax,z3
  1781.       mov cx,80
  1782.       mul cx
  1783.       add ax,z4
  1784.       inc ax
  1785.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1786.  
  1787.       mov es,[vseg]   {ES:DI}
  1788.       mov ds,[ballseg] {DS:SI}
  1789.       mov si,z1
  1790.       mov di,z2
  1791.       mov cx,4
  1792.       @l1:
  1793.         mov al,[ds:si]
  1794.         or al,al
  1795.         jz @l2
  1796.         mov ah,[es:di]
  1797.         cmp ah,farbe
  1798.         jz @l2
  1799.         mov [es:di],al
  1800.         @l2:
  1801.         inc si
  1802.         inc di
  1803.         dec cx
  1804.       jnz @l1
  1805.       mov al,z
  1806.       inc al
  1807.       mov z,al
  1808.       cmp al,16
  1809.       pop ds
  1810.     jnz @loop
  1811.     pop es
  1812.     pop cx
  1813.     pop di
  1814.     pop si
  1815.     pop ax
  1816.   end;
  1817.   {draw_ball_s4 3}
  1818.   asm
  1819.     push dx
  1820.     push ax
  1821.     mov dx,03c4h
  1822.     mov ax,514
  1823.     out dx,ax
  1824.     pop ax
  1825.     pop dx
  1826.  
  1827.     push ax
  1828.     push si
  1829.     push di
  1830.     push cx
  1831.     push es
  1832.  
  1833.     mov z,1
  1834.     @loop:
  1835.       push ds
  1836.       xor ah,ah
  1837.       mov al,z
  1838.       mov cl,4
  1839.       mul cl
  1840.       add ax,128
  1841.       mov z1,ax { z1:=z*4;}
  1842.       xor ah,ah
  1843.       mov al,z
  1844.       add ax,z3
  1845.       mov cx,80
  1846.       mul cx
  1847.       add ax,z4
  1848.       inc ax
  1849.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1850.  
  1851.       mov es,[vseg]   {ES:DI}
  1852.       mov ds,[ballseg] {DS:SI}
  1853.       mov si,z1
  1854.       mov di,z2
  1855.       mov cx,4
  1856.       @l1:
  1857.         mov al,[ds:si]
  1858.         or al,al
  1859.         jz @l2
  1860.         mov ah,[es:di]
  1861.         cmp ah,farbe
  1862.         jz @l2
  1863.         mov [es:di],al
  1864.         @l2:
  1865.         inc si
  1866.         inc di
  1867.         dec cx
  1868.       jnz @l1
  1869.       mov al,z
  1870.       inc al
  1871.       mov z,al
  1872.       cmp al,16
  1873.       pop ds
  1874.     jnz @loop
  1875.     pop es
  1876.     pop cx
  1877.     pop di
  1878.     pop si
  1879.     pop ax
  1880.   end;
  1881.   {draw_ball_s4 4}
  1882.   asm
  1883.     push dx
  1884.     push ax
  1885.     mov dx,03c4h
  1886.     mov ax,1026
  1887.     out dx,ax
  1888.     pop ax
  1889.     pop dx
  1890.  
  1891.     push ax
  1892.     push si
  1893.     push di
  1894.     push cx
  1895.     push es
  1896.  
  1897.     mov z,1
  1898.     @loop:
  1899.       push ds
  1900.       xor ah,ah
  1901.       mov al,z
  1902.       mov cl,4
  1903.       mul cl
  1904.       add ax,192
  1905.       mov z1,ax { z1:=z*4;}
  1906.       xor ah,ah
  1907.       mov al,z
  1908.       add ax,z3
  1909.       mov cx,80
  1910.       mul cx
  1911.       add ax,z4
  1912.       inc ax
  1913.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1914.  
  1915.       mov es,[vseg]   {ES:DI}
  1916.       mov ds,[ballseg] {DS:SI}
  1917.       mov si,z1
  1918.       mov di,z2
  1919.       mov cx,4
  1920.       @l1:
  1921.         mov al,[ds:si]
  1922.         or al,al
  1923.         jz @l2
  1924.         mov ah,[es:di]
  1925.         cmp ah,farbe
  1926.         jz @l2
  1927.         mov [es:di],al
  1928.         @l2:
  1929.         inc si
  1930.         inc di
  1931.         dec cx
  1932.       jnz @l1
  1933.       mov al,z
  1934.       inc al
  1935.       mov z,al
  1936.       cmp al,16
  1937.       pop ds
  1938.     jnz @loop
  1939.     pop es
  1940.     pop cx
  1941.     pop di
  1942.     pop si
  1943.     pop ax
  1944.   end;
  1945.  
  1946.  
  1947. end;
  1948.  
  1949.  
  1950. procedure draw_ground_s1;
  1951. var z:byte;
  1952.     z1,z2,z3,z4:word;
  1953. begin
  1954.   {Draw_Ground_s1 1}
  1955.   z3:=by_old+48;
  1956.   z4:=bx_old div 4;
  1957.   asm
  1958.     push dx
  1959.     push ax
  1960.     mov dx,03c4h
  1961.     mov ax,258
  1962.     out dx,ax
  1963.     pop ax
  1964.     pop dx
  1965.  
  1966.     push ax
  1967.     push si
  1968.     push di
  1969.     push cx
  1970.     push es
  1971.  
  1972.     mov z,1
  1973.     @loop:
  1974.       push ds
  1975.       xor ah,ah
  1976.       mov al,z
  1977.       mov cl,4
  1978.       mul cl
  1979.       mov z1,ax { z1:=z*4;}
  1980.  
  1981.       xor ah,ah
  1982.       mov al,z
  1983.       add ax,z3
  1984.       mov cx,80
  1985.       mul cx
  1986.       add ax,z4
  1987.       mov z2,ax {z2:=(z+z3)*80+z4;}
  1988.  
  1989.       mov es,[vseg]   {ES:DI}
  1990.       mov ds,[groundseg]
  1991.       mov si,z1
  1992.       mov di,z2
  1993.       mov cx,2
  1994.       rep movsw
  1995.  
  1996.       mov al,z
  1997.       inc al
  1998.       mov z,al
  1999.       cmp al,16
  2000.       pop ds
  2001.     jnz @loop
  2002.     pop es
  2003.     pop cx
  2004.     pop di
  2005.     pop si
  2006.     pop ax
  2007.   end;
  2008.  
  2009.   {Draw_Ground_S1 2}
  2010.   asm
  2011.     push dx
  2012.     push ax
  2013.     mov dx,03c4h
  2014.     mov ax,514
  2015.     out dx,ax
  2016.     pop ax
  2017.     pop dx
  2018.  
  2019.     push ax
  2020.     push si
  2021.     push di
  2022.     push cx
  2023.     push es
  2024.  
  2025.     mov z,1
  2026.     @loop:
  2027.       push ds
  2028.       xor ah,ah
  2029.       mov al,z
  2030.       mov cl,4
  2031.       mul cl
  2032.       add ax,64
  2033.       mov z1,ax { z1:=z*4;}
  2034.  
  2035.       xor ah,ah
  2036.       mov al,z
  2037.       add ax,z3
  2038.       mov cx,80
  2039.       mul cx
  2040.       add ax,z4
  2041.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2042.  
  2043.       mov es,[vseg]   {ES:DI}
  2044.       mov ds,[groundseg]
  2045.       mov si,z1
  2046.       mov di,z2
  2047.       mov cx,2
  2048.       rep movsw
  2049.  
  2050.       mov al,z
  2051.       inc al
  2052.       mov z,al
  2053.       cmp al,16
  2054.       pop ds
  2055.     jnz @loop
  2056.     pop es
  2057.     pop cx
  2058.     pop di
  2059.     pop si
  2060.     pop ax
  2061.   end;
  2062.  
  2063.  {Draw_Ground_S1 3}
  2064.   asm
  2065.     push dx
  2066.     push ax
  2067.     mov dx,03c4h
  2068.     mov ax,1026
  2069.     out dx,ax
  2070.     pop ax
  2071.     pop dx
  2072.  
  2073.     push ax
  2074.     push si
  2075.     push di
  2076.     push cx
  2077.     push es
  2078.  
  2079.     mov z,1
  2080.     @loop:
  2081.       push ds
  2082.       xor ah,ah
  2083.       mov al,z
  2084.       mov cl,4
  2085.       mul cl
  2086.       add ax,128
  2087.       mov z1,ax { z1:=z*4;}
  2088.  
  2089.       xor ah,ah
  2090.       mov al,z
  2091.       add ax,z3
  2092.       mov cx,80
  2093.       mul cx
  2094.       add ax,z4
  2095.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2096.  
  2097.       mov es,[vseg]   {ES:DI}
  2098.       mov ds,[groundseg]
  2099.       mov si,z1
  2100.       mov di,z2
  2101.       mov cx,2
  2102.       rep movsw
  2103.  
  2104.       mov al,z
  2105.       inc al
  2106.       mov z,al
  2107.       cmp al,16
  2108.       pop ds
  2109.     jnz @loop
  2110.     pop es
  2111.     pop cx
  2112.     pop di
  2113.     pop si
  2114.     pop ax
  2115.   end;
  2116.  
  2117.   {Draw_Ground_S1 4}
  2118.   asm
  2119.     push dx
  2120.     push ax
  2121.     mov dx,03c4h
  2122.     mov ax,2050
  2123.     out dx,ax
  2124.     pop ax
  2125.     pop dx
  2126.  
  2127.     push ax
  2128.     push si
  2129.     push di
  2130.     push cx
  2131.     push es
  2132.  
  2133.     mov z,1
  2134.     @loop:
  2135.       push ds
  2136.       xor ah,ah
  2137.       mov al,z
  2138.       mov cl,4
  2139.       mul cl
  2140.       add ax,192
  2141.       mov z1,ax { z1:=z*4;}
  2142.  
  2143.       xor ah,ah
  2144.       mov al,z
  2145.       add ax,z3
  2146.       mov cx,80
  2147.       mul cx
  2148.       add ax,z4
  2149.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2150.  
  2151.       mov es,[vseg]   {ES:DI}
  2152.       mov ds,[groundseg]
  2153.       mov si,z1
  2154.       mov di,z2
  2155.       mov cx,2
  2156.       rep movsw
  2157.  
  2158.       mov al,z
  2159.       inc al
  2160.       mov z,al
  2161.       cmp al,16
  2162.       pop ds
  2163.     jnz @loop
  2164.     pop es
  2165.     pop cx
  2166.     pop di
  2167.     pop si
  2168.     pop ax
  2169.   end;
  2170. end;
  2171.  
  2172. procedure draw_ground_s2;
  2173. var z:byte;
  2174.     z1,z2,z3,z4:word;
  2175. begin
  2176.   z3:=by_old+48;
  2177.   z4:=bx_old div 4;
  2178.  
  2179.   {Draw_Ground_S2 1}
  2180.   asm
  2181.     push dx
  2182.     push ax
  2183.     mov dx,03c4h
  2184.     mov ax,514
  2185.     out dx,ax
  2186.     pop ax
  2187.     pop dx
  2188.  
  2189.     push ax
  2190.     push si
  2191.     push di
  2192.     push cx
  2193.     push es
  2194.  
  2195.     mov z,1
  2196.     @loop:
  2197.       push ds
  2198.       xor ah,ah
  2199.       mov al,z
  2200.       mov cl,4
  2201.       mul cl
  2202.       mov z1,ax { z1:=z*4;}
  2203.  
  2204.       xor ah,ah
  2205.       mov al,z
  2206.       add ax,z3
  2207.       mov cx,80
  2208.       mul cx
  2209.       add ax,z4
  2210.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2211.  
  2212.       mov es,[vseg]   {ES:DI}
  2213.       mov ds,[groundseg]
  2214.       mov si,z1
  2215.       mov di,z2
  2216.       mov cx,2
  2217.       rep movsw
  2218.  
  2219.       mov al,z
  2220.       inc al
  2221.       mov z,al
  2222.       cmp al,16
  2223.       pop ds
  2224.     jnz @loop
  2225.     pop es
  2226.     pop cx
  2227.     pop di
  2228.     pop si
  2229.     pop ax
  2230.   end;
  2231.  
  2232.  {Draw_Ground_S2 2}
  2233.   asm
  2234.     push dx
  2235.     push ax
  2236.     mov dx,03c4h
  2237.     mov ax,1026
  2238.     out dx,ax
  2239.     pop ax
  2240.     pop dx
  2241.  
  2242.     push ax
  2243.     push si
  2244.     push di
  2245.     push cx
  2246.     push es
  2247.  
  2248.     mov z,1
  2249.     @loop:
  2250.       push ds
  2251.       xor ah,ah
  2252.       mov al,z
  2253.       mov cl,4
  2254.       mul cl
  2255.       add ax,64
  2256.       mov z1,ax { z1:=z*4;}
  2257.  
  2258.       xor ah,ah
  2259.       mov al,z
  2260.       add ax,z3
  2261.       mov cx,80
  2262.       mul cx
  2263.       add ax,z4
  2264.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2265.  
  2266.       mov es,[vseg]   {ES:DI}
  2267.       mov ds,[groundseg]
  2268.       mov si,z1
  2269.       mov di,z2
  2270.       mov cx,2
  2271.       rep movsw
  2272.  
  2273.       mov al,z
  2274.       inc al
  2275.       mov z,al
  2276.       cmp al,16
  2277.       pop ds
  2278.     jnz @loop
  2279.     pop es
  2280.     pop cx
  2281.     pop di
  2282.     pop si
  2283.     pop ax
  2284.   end;
  2285.  
  2286.   {Draw_Ground_S2 3}
  2287.   asm
  2288.     push dx
  2289.     push ax
  2290.     mov dx,03c4h
  2291.     mov ax,2050
  2292.     out dx,ax
  2293.     pop ax
  2294.     pop dx
  2295.  
  2296.     push ax
  2297.     push si
  2298.     push di
  2299.     push cx
  2300.     push es
  2301.  
  2302.     mov z,1
  2303.     @loop:
  2304.       push ds
  2305.       xor ah,ah
  2306.       mov al,z
  2307.       mov cl,4
  2308.       mul cl
  2309.       add ax,128
  2310.       mov z1,ax { z1:=z*4;}
  2311.  
  2312.       xor ah,ah
  2313.       mov al,z
  2314.       add ax,z3
  2315.       mov cx,80
  2316.       mul cx
  2317.       add ax,z4
  2318.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2319.  
  2320.       mov es,[vseg]   {ES:DI}
  2321.       mov ds,[groundseg]
  2322.       mov si,z1
  2323.       mov di,z2
  2324.       mov cx,2
  2325.       rep movsw
  2326.  
  2327.       mov al,z
  2328.       inc al
  2329.       mov z,al
  2330.       cmp al,16
  2331.       pop ds
  2332.     jnz @loop
  2333.     pop es
  2334.     pop cx
  2335.     pop di
  2336.     pop si
  2337.     pop ax
  2338.   end;
  2339.  
  2340.   {DRAW_GROUND_S2 4}
  2341.   asm
  2342.     push dx
  2343.     push ax
  2344.     mov dx,03c4h
  2345.     mov ax,258
  2346.     out dx,ax
  2347.     pop ax
  2348.     pop dx
  2349.  
  2350.     push ax
  2351.     push si
  2352.     push di
  2353.     push cx
  2354.     push es
  2355.  
  2356.     mov z,1
  2357.     @loop:
  2358.       push ds
  2359.       xor ah,ah
  2360.       mov al,z
  2361.       mov cl,4
  2362.       mul cl
  2363.       add ax,192
  2364.       mov z1,ax { z1:=z*4;}
  2365.  
  2366.       xor ah,ah
  2367.       mov al,z
  2368.       add ax,z3
  2369.       mov cx,80
  2370.       mul cx
  2371.       add ax,z4
  2372.       inc ax
  2373.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2374.  
  2375.       mov es,[vseg]   {ES:DI}
  2376.       mov ds,[groundseg]
  2377.       mov si,z1
  2378.       mov di,z2
  2379.       mov cx,2
  2380.       rep movsw
  2381.  
  2382.       mov al,z
  2383.       inc al
  2384.       mov z,al
  2385.       cmp al,16
  2386.       pop ds
  2387.     jnz @loop
  2388.     pop es
  2389.     pop cx
  2390.     pop di
  2391.     pop si
  2392.     pop ax
  2393.   end;
  2394. end;
  2395.  
  2396. procedure draw_ground_s3;
  2397. var z:byte;
  2398.     z1,z2,z3,z4:word;
  2399. begin
  2400.   z3:=by_old+48;
  2401.   z4:=bx_old div 4;
  2402.  
  2403.  {draw_ground_s3 1}
  2404.   asm
  2405.     push dx
  2406.     push ax
  2407.     mov dx,03c4h
  2408.     mov ax,1026
  2409.     out dx,ax
  2410.     pop ax
  2411.     pop dx
  2412.  
  2413.     push ax
  2414.     push si
  2415.     push di
  2416.     push cx
  2417.     push es
  2418.  
  2419.     mov z,1
  2420.     @loop:
  2421.       push ds
  2422.       xor ah,ah
  2423.       mov al,z
  2424.       mov cl,4
  2425.       mul cl
  2426.       mov z1,ax { z1:=z*4;}
  2427.  
  2428.       xor ah,ah
  2429.       mov al,z
  2430.       add ax,z3
  2431.       mov cx,80
  2432.       mul cx
  2433.       add ax,z4
  2434.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2435.  
  2436.       mov es,[vseg]   {ES:DI}
  2437.       mov ds,[groundseg]
  2438.       mov si,z1
  2439.       mov di,z2
  2440.       mov cx,2
  2441.       rep movsw
  2442.  
  2443.       mov al,z
  2444.       inc al
  2445.       mov z,al
  2446.       cmp al,16
  2447.       pop ds
  2448.     jnz @loop
  2449.     pop es
  2450.     pop cx
  2451.     pop di
  2452.     pop si
  2453.     pop ax
  2454.   end;
  2455.  
  2456.   {draw_ground_s3 2}
  2457.   asm
  2458.     push dx
  2459.     push ax
  2460.     mov dx,03c4h
  2461.     mov ax,2050
  2462.     out dx,ax
  2463.     pop ax
  2464.     pop dx
  2465.  
  2466.     push ax
  2467.     push si
  2468.     push di
  2469.     push cx
  2470.     push es
  2471.  
  2472.     mov z,1
  2473.     @loop:
  2474.       push ds
  2475.       xor ah,ah
  2476.       mov al,z
  2477.       mov cl,4
  2478.       mul cl
  2479.       add ax,64
  2480.       mov z1,ax { z1:=z*4;}
  2481.  
  2482.       xor ah,ah
  2483.       mov al,z
  2484.       add ax,z3
  2485.       mov cx,80
  2486.       mul cx
  2487.       add ax,z4
  2488.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2489.  
  2490.       mov es,[vseg]   {ES:DI}
  2491.       mov ds,[groundseg]
  2492.       mov si,z1
  2493.       mov di,z2
  2494.       mov cx,2
  2495.       rep movsw
  2496.  
  2497.       mov al,z
  2498.       inc al
  2499.       mov z,al
  2500.       cmp al,16
  2501.       pop ds
  2502.     jnz @loop
  2503.     pop es
  2504.     pop cx
  2505.     pop di
  2506.     pop si
  2507.     pop ax
  2508.   end;
  2509.  
  2510.   {draw_ground_s3 3}
  2511.   asm
  2512.     push dx
  2513.     push ax
  2514.     mov dx,03c4h
  2515.     mov ax,258
  2516.     out dx,ax
  2517.     pop ax
  2518.     pop dx
  2519.  
  2520.     push ax
  2521.     push si
  2522.     push di
  2523.     push cx
  2524.     push es
  2525.  
  2526.     mov z,1
  2527.     @loop:
  2528.       push ds
  2529.       xor ah,ah
  2530.       mov al,z
  2531.       mov cl,4
  2532.       mul cl
  2533.       add ax,128
  2534.       mov z1,ax { z1:=z*4;}
  2535.  
  2536.       xor ah,ah
  2537.       mov al,z
  2538.       add ax,z3
  2539.       mov cx,80
  2540.       mul cx
  2541.       add ax,z4
  2542.       inc ax
  2543.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2544.  
  2545.       mov es,[vseg]   {ES:DI}
  2546.       mov ds,[groundseg]
  2547.       mov si,z1
  2548.       mov di,z2
  2549.       mov cx,2
  2550.       rep movsw
  2551.  
  2552.       mov al,z
  2553.       inc al
  2554.       mov z,al
  2555.       cmp al,16
  2556.       pop ds
  2557.     jnz @loop
  2558.     pop es
  2559.     pop cx
  2560.     pop di
  2561.     pop si
  2562.     pop ax
  2563.   end;
  2564.  
  2565.   {draw_ground_s3 4}
  2566.   asm
  2567.     push dx
  2568.     push ax
  2569.     mov dx,03c4h
  2570.     mov ax,514
  2571.     out dx,ax
  2572.     pop ax
  2573.     pop dx
  2574.  
  2575.     push ax
  2576.     push si
  2577.     push di
  2578.     push cx
  2579.     push es
  2580.  
  2581.     mov z,1
  2582.     @loop:
  2583.       push ds
  2584.       xor ah,ah
  2585.       mov al,z
  2586.       mov cl,4
  2587.       mul cl
  2588.       add ax,192
  2589.       mov z1,ax { z1:=z*4;}
  2590.  
  2591.       xor ah,ah
  2592.       mov al,z
  2593.       add ax,z3
  2594.       mov cx,80
  2595.       mul cx
  2596.       add ax,z4
  2597.       inc ax
  2598.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2599.  
  2600.       mov es,[vseg]   {ES:DI}
  2601.       mov ds,[groundseg]
  2602.       mov si,z1
  2603.       mov di,z2
  2604.       mov cx,2
  2605.       rep movsw
  2606.  
  2607.       mov al,z
  2608.       inc al
  2609.       mov z,al
  2610.       cmp al,16
  2611.       pop ds
  2612.     jnz @loop
  2613.     pop es
  2614.     pop cx
  2615.     pop di
  2616.     pop si
  2617.     pop ax
  2618.   end;
  2619. end;
  2620.  
  2621. procedure draw_ground_s4;
  2622. var z:byte;
  2623.     z1,z2,z3,z4:word;
  2624. begin
  2625.   z3:=by_old+48;
  2626.   z4:=bx_old div 4;
  2627.   {draw_ground_s4 1}
  2628.   asm
  2629.     push dx
  2630.     push ax
  2631.     mov dx,03c4h
  2632.     mov ax,2050
  2633.     out dx,ax
  2634.     pop ax
  2635.     pop dx
  2636.  
  2637.     push ax
  2638.     push si
  2639.     push di
  2640.     push cx
  2641.     push es
  2642.  
  2643.     mov z,1
  2644.     @loop:
  2645.       push ds
  2646.       xor ah,ah
  2647.       mov al,z
  2648.       mov cl,4
  2649.       mul cl
  2650.       mov z1,ax { z1:=z*4;}
  2651.  
  2652.       xor ah,ah
  2653.       mov al,z
  2654.       add ax,z3
  2655.       mov cx,80
  2656.       mul cx
  2657.       add ax,z4
  2658.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2659.  
  2660.       mov es,[vseg]   {ES:DI}
  2661.       mov ds,[groundseg]
  2662.       mov si,z1
  2663.       mov di,z2
  2664.       mov cx,2
  2665.       rep movsw
  2666.  
  2667.       mov al,z
  2668.       inc al
  2669.       mov z,al
  2670.       cmp al,16
  2671.       pop ds
  2672.     jnz @loop
  2673.     pop es
  2674.     pop cx
  2675.     pop di
  2676.     pop si
  2677.     pop ax
  2678.   end;
  2679.  
  2680.   {draw_ground_s4 2}
  2681.   asm
  2682.     push dx
  2683.     push ax
  2684.     mov dx,03c4h
  2685.     mov ax,258
  2686.     out dx,ax
  2687.     pop ax
  2688.     pop dx
  2689.  
  2690.     push ax
  2691.     push si
  2692.     push di
  2693.     push cx
  2694.     push es
  2695.  
  2696.     mov z,1
  2697.     @loop:
  2698.       push ds
  2699.       xor ah,ah
  2700.       mov al,z
  2701.       mov cl,4
  2702.       mul cl
  2703.       add ax,64
  2704.       mov z1,ax { z1:=z*4;}
  2705.  
  2706.       xor ah,ah
  2707.       mov al,z
  2708.       add ax,z3
  2709.       mov cx,80
  2710.       mul cx
  2711.       add ax,z4
  2712.       inc ax
  2713.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2714.  
  2715.       mov es,[vseg]   {ES:DI}
  2716.       mov ds,[groundseg]
  2717.       mov si,z1
  2718.       mov di,z2
  2719.       mov cx,2
  2720.       rep movsw
  2721.  
  2722.       mov al,z
  2723.       inc al
  2724.       mov z,al
  2725.       cmp al,16
  2726.       pop ds
  2727.     jnz @loop
  2728.     pop es
  2729.     pop cx
  2730.     pop di
  2731.     pop si
  2732.     pop ax
  2733.   end;
  2734.  
  2735.   {draw_ground_s4 3}
  2736.   asm
  2737.     push dx
  2738.     push ax
  2739.     mov dx,03c4h
  2740.     mov ax,514
  2741.     out dx,ax
  2742.     pop ax
  2743.     pop dx
  2744.  
  2745.     push ax
  2746.     push si
  2747.     push di
  2748.     push cx
  2749.     push es
  2750.  
  2751.     mov z,1
  2752.     @loop:
  2753.       push ds
  2754.       xor ah,ah
  2755.       mov al,z
  2756.       mov cl,4
  2757.       mul cl
  2758.       add ax,128
  2759.       mov z1,ax { z1:=z*4;}
  2760.  
  2761.       xor ah,ah
  2762.       mov al,z
  2763.       add ax,z3
  2764.       mov cx,80
  2765.       mul cx
  2766.       add ax,z4
  2767.       inc ax
  2768.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2769.  
  2770.       mov es,[vseg]   {ES:DI}
  2771.       mov ds,[groundseg]
  2772.       mov si,z1
  2773.       mov di,z2
  2774.       mov cx,2
  2775.       rep movsw
  2776.  
  2777.       mov al,z
  2778.       inc al
  2779.       mov z,al
  2780.       cmp al,16
  2781.       pop ds
  2782.     jnz @loop
  2783.     pop es
  2784.     pop cx
  2785.     pop di
  2786.     pop si
  2787.     pop ax
  2788.   end;
  2789.  
  2790.  {draw_ground_s4 4}
  2791.   asm
  2792.     push dx
  2793.     push ax
  2794.     mov dx,03c4h
  2795.     mov ax,1026
  2796.     out dx,ax
  2797.     pop ax
  2798.     pop dx
  2799.  
  2800.     push ax
  2801.     push si
  2802.     push di
  2803.     push cx
  2804.     push es
  2805.  
  2806.     mov z,1
  2807.     @loop:
  2808.       push ds
  2809.       xor ah,ah
  2810.       mov al,z
  2811.       mov cl,4
  2812.       mul cl
  2813.       add ax,192
  2814.       mov z1,ax { z1:=z*4;}
  2815.  
  2816.       xor ah,ah
  2817.       mov al,z
  2818.       add ax,z3
  2819.       mov cx,80
  2820.       mul cx
  2821.       add ax,z4
  2822.       inc ax
  2823.       mov z2,ax {z2:=(z+z3)*80+z4;}
  2824.  
  2825.       mov es,[vseg]   {ES:DI}
  2826.       mov ds,[groundseg]
  2827.       mov si,z1
  2828.       mov di,z2
  2829.       mov cx,2
  2830.       rep movsw
  2831.  
  2832.       mov al,z
  2833.       inc al
  2834.       mov z,al
  2835.       cmp al,16
  2836.       pop ds
  2837.     jnz @loop
  2838.     pop es
  2839.     pop cx
  2840.     pop di
  2841.     pop si
  2842.     pop ax
  2843.   end;
  2844. end;
  2845.  
  2846.  
  2847.